package com.foreknow.test;

/**
 * 什么时候用构造器初始化  什么时候直接利用0和null初始化
 */
public class Person {
  private int age;
  private String school;

  public Person(int age,String school){
    this.age = age;
    this.school = school;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public String getSchool() {
    return school;
  }

  public void setSchool(String school) {
    this.school = school;
  }

  public String method() {
    System.out.println("method......");
    return "abc";
  }
  public static void main(String[] args) {
    //局部变量一定要先初始化之后才能使用
    int a = 0;
    System.out.println(a);

    //    Person p = new Person();
    //    System.out.println(p.method());

    //    for(int i = 0;i<4;i++){
    //      System.out.println(i);
    //    }
    //    System.out.println(i);
  }
}
